package cn.glow.readingcloud.book.service;

import cn.glow.readingcloud.common.result.Result;
import com.baomidou.mybatisplus.extension.service.IService;
import pojo.BookChapter;
import pojo.BookChapterPage;

/**
 * @Author Glow
 * @Date 2023-04-15 11:32:32
 * @Description
 * @Version 1.0
 */
public interface BookChapterService extends IService<BookChapter> {

    /**
     * 获取章节目录
     * @param bookId
     * @return
     */
    Result getBookChapterListByBookId(String bookId);

    /**
     * 获取章节内容
     * @param chapterId
     * @return
     */
    Result<BookChapter> getChapterById(String bookId, Integer chapterId);

    /**
     * 阅读章节
     * @param bookId
     * @param chapterId 章节ID(0获取首章节，-1获取末章节)
     * @return
     */
    Result<BookChapterPage> readChapter(String bookId, Integer chapterId);
}
